/*
 * @Author: Nico 339477680@qq.com
 * @Date: 2023-05-24 10:36:26
 * @LastEditors: Nico 339477680@qq.com
 * @LastEditTime: 2023-05-24 16:46:20
 * @FilePath: \yunshop-front-master-huzhu\yunshop-front-master\src\views\newpage.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export default {
  data() {
    return {
      list_vIaPSEdR: [null, null, null, null, null, null],
      activeTab: 0,
      tabs:[{ name: "10元乐拼区", goods: "1" },{ name: "100元乐拼区", goods: "2" },{ name: "1000元乐拼区", goods: "3" },{ name: "10000元乐拼区", goods: "4" },
      ],
      ulList:[],
      tabList:[],
      goods:1,
      ulList:[],
      play: false,
    };
  },
  mounted() {
    this.setUserInfo();
    this.scrolls();
  },
  methods: { setUserInfo() {
    $http.get("plugin.share-chain.frontend.queue.getListNew", {
      source_code:'shop',
      goods:this.goods
    }).then(
      (response)=> {
        console.log(response.data.data);
        this.ulList = response.data.reward.data;
        this.tabList = response.data.data
      },
      (response)=> {
        console.error(response);
      }
    );
  },qwe(tab,index){
    this.activeTab = index
    this.goods = tab.goods
    this.setUserInfo()
    console.log(tab.goods);
  },asd(){
    this.$router.go(-1);//返回上一层
  }, scrolls() {
    var parent = document.getElementById("parent");
    var child1 = document.getElementById("child1");
    var child2 = document.getElementById("child2");
    child2.innerHTML = child1.innerHTML;
    setInterval(function () {
      if (parent.scrollTop >= child1.scrollHeight) {
        parent.scrollTop = 0;
      } else {
        parent.scrollTop += 2;
      }
    }, 40);
  },
  startPlay() {
    let that = this;
    that.play = true; //开始播放
    setTimeout(() => {
      that.ulList.push(that.ulList[0]); //将第一条数据塞到最后一个
      that.ulList.shift(); //删除第一条数据
      that.play = false; //暂停播放,此处修改，保证每一次都会有动画显示
    }, 100);
  },

  },
  created() {
  },
  components: {}
};
